unit ufrmSiembrasUsuario;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DateUtils, Generics.Collections, cxGraphics, cxControls,
  cxLookAndFeels, cxLookAndFeelPainters, cxStyles, dxSkinsCore,
  dxSkinOffice2007Blue, dxSkinscxPCPainter, cxCustomData, cxFilter, cxData,
  cxDataStorage, cxEdit, cxNavigator, Data.DB, cxDBData, dxRibbonSkins,
  dxSkinsdxRibbonPainter, Data.FMTBcd, dxSkinsdxBarPainter, Vcl.ImgList, dxBar,
  Data.SqlExpr, Datasnap.Provider, Datasnap.DBClient, cxClasses, dxRibbon,
  cxGridLevel, cxGridChartView, cxGridDBChartView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGrid, cxScrollBox;

type
  TfrmSiembrasUsuario = class(TForm)
    ScrollBox1: TcxScrollBox;
    cxGrid1: TcxGrid;
    cxGrid1DBTableView1: TcxGridDBTableView;
    cxGrid1DBChartView1: TcxGridDBChartView;
    cxGrid1DBChartView1Series0: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series1: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series2: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series3: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series4: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series5: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series6: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series7: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series8: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series9: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series10: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series11: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series12: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series13: TcxGridDBChartSeries;
    cxGrid1DBChartView1Series14: TcxGridDBChartSeries;
    cxGrid1Level1: TcxGridLevel;
    dxBarManager1: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    dxBarLargeButton1: TdxBarLargeButton;
    dxRibbon1: TdxRibbon;
    dxRibbon1Tab1: TdxRibbonTab;
    dxBarLargeButton2: TdxBarLargeButton;
    ImageList16: TcxImageList;
    ImageList32: TcxImageList;
    cxGrid1DBTableView1USUARIO: TcxGridDBColumn;
    cxGrid1DBTableView1SIEMBRA: TcxGridDBColumn;
    cxGrid1DBTableView1CULTIVO: TcxGridDBColumn;
    cxGrid1DBTableView1CICLO: TcxGridDBColumn;
    cxGrid1DBTableView1VARIEDAD: TcxGridDBColumn;
    cxGrid1DBTableView1SUPERFICIE: TcxGridDBColumn;
    cxGrid1DBTableView1VOLUMEN: TcxGridDBColumn;
    cxGrid1DBTableView1SUBSISTEMA: TcxGridDBColumn;
    cxGrid1DBTableView1SISTEMA: TcxGridDBColumn;
    cxGrid1DBTableView1RENDIMIENTO: TcxGridDBColumn;
    procedure dxBarLargeButton1Click(Sender: TObject);
    procedure dxBarLargeButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSiembrasUsuario: TfrmSiembrasUsuario;

implementation

uses
  udmData, cxGridExportLink;

{$R *.dfm}

procedure TfrmSiembrasUsuario.dxBarLargeButton1Click(Sender: TObject);
begin
  Screen.Cursor := crHourglass;
  try
    with dmData.cdsSiembrasUsuario do
    begin
      Close;
      Params.ParamByName('UCIDUSER').Value:=
        dmData.cdsUsuarioUCIDUSER.Value;
      Open;
    end;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TfrmSiembrasUsuario.dxBarLargeButton2Click(Sender: TObject);
begin
  dmData.Exportar(cxGrid1);
end;

initialization
  RegisterClass(TfrmSiembrasUsuario);

end.
